# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequest do
  @moduledoc """
  Request for ComputeEnvironmentScores.

  ## Attributes

  *   `filters` (*type:* `list(GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequestFilter.t)`, *default:* `nil`) - Optional. Filters are used to filter scored components. Return all the components if no filter is mentioned. Example: [{ "scorePath": "/org@myorg/envgroup@myenvgroup/env@myenv/proxies/proxy@myproxy/source" }, { "scorePath": "/org@myorg/envgroup@myenvgroup/env@myenv/proxies/proxy@myproxy/target", }] This will return components with path: "/org@myorg/envgroup@myenvgroup/env@myenv/proxies/proxy@myproxy/source" OR "/org@myorg/envgroup@myenvgroup/env@myenv/proxies/proxy@myproxy/target"
  *   `pageSize` (*type:* `integer()`, *default:* `nil`) - Optional. The maximum number of subcomponents to be returned in a single page. The service may return fewer than this value. If unspecified, at most 100 subcomponents will be returned in a single page.
  *   `pageToken` (*type:* `String.t`, *default:* `nil`) - Optional. A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
  *   `timeRange` (*type:* `GoogleApi.Apigee.V1.Model.GoogleTypeInterval.t`, *default:* `nil`) - Required. Time range for score calculation. At most 14 days of scores will be returned, and both the start and end dates must be within the last 90 days.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :filters =>
            list(
              GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequestFilter.t()
            )
            | nil,
          :pageSize => integer() | nil,
          :pageToken => String.t() | nil,
          :timeRange => GoogleApi.Apigee.V1.Model.GoogleTypeInterval.t() | nil
        }

  field(:filters,
    as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequestFilter,
    type: :list
  )

  field(:pageSize)
  field(:pageToken)
  field(:timeRange, as: GoogleApi.Apigee.V1.Model.GoogleTypeInterval)
end

defimpl Poison.Decoder,
  for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequest do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ComputeEnvironmentScoresRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
